1. Field of the Invention
The invention relates to an image processing device for converting color spaces of image data. The invention also relates to an electronic camera on which the image processing device is mounted, and an image processing program.
2. Description of the Related Art
In general, image data created by a color image processing device such as an electronic camera, a digital video camera, and a scanner is initially subjected to processings including color conversion, tone processing, and contour enhancement processing. The image data is then recorded on a recording medium such as a memory and a magnetic tape, or transmitted to external equipment via communication media. The recorded image data is reproduced, for example, as a photograph by a developing machine, a printer, etc. The transmitted image data is reproduced on a monitor as a moving image or a still image, for example.
In order to reproduce the colors of the recorded or transmitted image data accurately, the image-capturing side and the reproduction side need to process the image data by using the same standard. For this purpose, various types of standards (color spaces) for expressing colors have been established. Then, the color coordinates of the three principal colors (R, G, and B) differ from one standard to another.
FIG. 1 shows an xy chromaticity diagram showing NTSC color space and sRGB color space. Note that the horseshoe shaped area is a color range that humans are perceptible of (hereinafter, to be referred to as visible region). The image-capturing side can encode only colors inside the respective triangles with the coordinates of R, G, and B as the vertexes in the color space it uses. Similarly, the reproduction side can reproduce only colors inside the respective triangles with the coordinates of R, G, and B as the vertexes in the color space it uses. In the present invention, the range of colors that can be thus expressed in a color space, as well as the range of color distribution of a subject, shall be referred to as color gamut. As is evident from FIG. 1, the ranges of colors that can be expressed in NTSC color space and sRGB color space are smaller than the visible region. This also holds for most other color spaces (including CIE RGB and Adobe RGB (TM)).
When the color space determined according to the color filters of an image sensor does not cover the color gamut of a subject, the colors of the subject is not reproducible accurately from the image data created by this image-capturing system. Additionally, even with the image-capturing system having a color space that covers the color gamut of a subject, it is not possible to reproduce the colors of the subject with accuracy if the image data created by this image-capturing system is converted into such image data that it is rendered in a color space not covering the color gamut of the subject.
In view of this, Japanese Unexamined Patent Application Publication No. 2002-109523 has proposed a method of establishing a new color space capable of expressing all colors and capturing an image in this color space. This new color space differs from the known color spaces in the coordinates of the three principal colors. The image data based on the new three principal colors is thus converted into image data based on known three principal colors before output to an existing image output apparatus.
In general, image data yet to be compressed consists of pixels whose colors are encoded in a predetermined number of bits each (for example, 8 bits for each of the three principal colors). If encoded in a larger color space, the captured image data is thus expected to be greater in color difference per tone. Once the image data is encoded in wider tones, it is impossible to make the tones finer in subsequent processings. A greater color difference per tone results in unclear reproduced images and making it difficult to process the image data.
Besides, it is troublesome and difficult for the user to select an appropriate color space depending on the subject because he or she is required to have expertise on NTSC, sRGB, and other color spaces.